<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<!-- 回购 -->
<%@ include file="/common/init.jsp"%>
<script src="<c:url value='/resources/js/jquery-1.7.2.min.js"'/>"></script>
<link href="<c:url value='/admin/css/custom.css" rel="stylesheet'/>" type="text/css" />
<link href="<c:url value='/admin/css/style_new" rel="stylesheet'/>" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/mask.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/My97DatePicker/WdatePicker.js'/>"></script>
<div class="EpmsSubTitle"><p><b>股票增持</b></p></div>
<form method="post" action="stockAdd.action?cmd=search" id="stockSaBForm">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
        <tr>
            <td class=EpmsTdTitle >用户id：</td>
            <td class=EpmsTdNoColor >
                <input type="text" value="" name="userId" style="width:100px;"/>
               <input type="submit" value="搜索"/> &nbsp;&nbsp; | &nbsp;&nbsp;
                增持数量：
				<input type="text" name="numx" id="numx" style="width:100px;">
                增持股票类型：
                <select name="stockType" id="stockType" style="width:80px;">
                    <option value="A">A</option>
                    <option value="B">B</option>
                    <option value="C">C</option>
                    <option value="D">D</option>
                    <option value="E">E</option>
                    <option value="F">F</option>
                </select>
                <input type="button" value="确认增持" id="stockAdd1"/>
            </td>
        </tr>
    </table>
</form>
<div class="EpmsSubTitle"><p><b>数据列表</b></p>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
    <tr>
        <td class=EpmsTdTitle>选择</td>
        <td class=EpmsTdTitle>类型</td>
        <td class=EpmsTdTitle>用户名</td>
        <td class=EpmsTdTitle>剩余股数</td>
    </tr>
    <c:forEach var="stock" items="${stockList }" varStatus="index">
        <tr>
            <td class=EpmsTdNoColor ><input type="checkbox" name="userx" value="${stock.id }"></td>
            <td class=EpmsTdNoColor >${stock.stockType}</td>
            <td class=EpmsTdNoColor >${stock.userId }</td>
            <td class=EpmsTdNoColor >${stock.stockNum }</td>
        </tr>
    </c:forEach>
</table>
<script>
    $("#stockAdd1").click(function(){
        var userx = $("input[name=userx]").filter(":checked");
        if(userx.size() == 0){
            alert("请选择用户后操作。");
            return;
        }
        if(userx.size() > 1){
            alert("一次只能选择一种类型股票。");
            return;
        }
        var userids = $(userx).val();
        
        if(window.confirm("确认进行此操作吗？")){
            $('#stockSale1').attr("disabled", true);
            var form = $("#stockSaBForm");
            form.attr("action","stockAdd.action?cmd=stockAdd&userids="+userids+"&num="+$("#numx").val());
            form[0].submit();
        }
    });
</script>